-
-
Notifications
You must be signed in to change notification settings - Fork 636
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Adjust FaaS docs for layout = "zip"
#19180
Conversation
63c9011
to
b954363
Compare
b954363
to
91ad8fd
Compare
Wrote code bundle to dist/project.zip | ||
Runtime: python3.8 | ||
Handler: lambdex_handler.handler | ||
$ pants package project/:lambda |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The change from file path to proper target is a drive-by fix up to make the docs align with #18737, not related to/required by the layout change.
91ad8fd
to
5cd5142
Compare
layout = "zip" | ||
``` | ||
|
||
To temporarily continue using the old behaviour in Pants 2.17, instead set `layout = "lambdex"`. This will not be supported in Pants 2.19. If you encounter a bug with `layout = "zip"`, [please let us know](https://github.com/pantsbuild/pants/issues/new/choose). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Theoretically, we could also document the ability to use a pex_binary
as a Lambda artefact directly (e..g if a user needs the dynamic initialisation), with the __pex__.
prefix on the handler. Thoughts?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't hurt! But it is an advanced topic, and should be introduced as such. "In the rare case where you need to X..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added a dedicated section "Advanced: Using PEX directly" section, outside this one (but linked to it), because those docs seem like they'll be relevant even after this transition is ancient history.
layout = "zip" | ||
``` | ||
|
||
To temporarily continue using the old behaviour in Pants 2.17, instead set `layout = "lambdex"`. This will not be supported in Pants 2.19. If you encounter a bug with `layout = "zip"`, [please let us know](https://github.com/pantsbuild/pants/issues/new/choose). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can't hurt! But it is an advanced topic, and should be introduced as such. "In the rare case where you need to X..."
You must specify the handler as `handler`. | ||
You must specify the handler as `handler`. This is a re-export of the function referred to by the `handler` field of the target. | ||
|
||
Advanced: Using PEX directly |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've never used GCF, so this is purely 'from the books', especially the stuff about GOOGLE_FUNCTION_SOURCE
. I don't know if it works as I've described, in practice. 🤷
Oops, forgot the typo fix from #19122 (comment). Added now. I also read through after a night's sleep and found a few other minor typos/poor phrasing, so fixed them. |
This adjusts the AWS Lambda and Google Cloud Function documentation for the new Zip layout, added in pantsbuild#19076 and targeted for 2.17. This PR is just what's required for 2.17, ready to cherry-pick. The "Migrating" section is written with this in mind. It will require adjustment for 2.18 to reflect the change in defaults, and, hopefully, support for AWS Lambda Layers (pantsbuild#18880, pantsbuild#19123). Fixes pantsbuild#19067
This adjusts the AWS Lambda and Google Cloud Function documentation for the new Zip layout, added in #19076 and targeted for 2.17. This PR is just what's required for 2.17, ready to cherry-pick. The "Migrating" section is written with this in mind. It will require adjustment for 2.18 to reflect the change in defaults, and, hopefully, support for AWS Lambda Layers (#18880, #19123). Fixes #19067
Small typo in #19180: the target name is `lambda`, and hence the PEX name will be `lambda.pex`, not `lambdex.pex`.
Small typo in #19180: the target name is `lambda`, and hence the PEX name will be `lambda.pex`, not `lambdex.pex`.
Small typo in #19180: the target name is `lambda`, and hence the PEX name will be `lambda.pex`, not `lambdex.pex`.
This adjusts the AWS Lambda and Google Cloud Function documentation for the new Zip layout, added in #19076 and targeted for 2.17.
This PR is just what's required for 2.17, ready to cherry-pick. The "Migrating" section is written with this in mind. It will require adjustment for 2.18 to reflect the change in defaults, and, hopefully, support for AWS Lambda Layers (#18880, #19123).
Fixes #19067